<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="__ADMIN__/css/font.css">
<link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
<script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/layui/layui.js?t=1.1" charset="utf-8"></script>
<script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
<script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
<link rel="stylesheet" href="/static/admin/css/font.css">
<link rel="stylesheet" href="/static/admin/css/font-awesome.min.css">
<style>
.layui-form-item .layui-form-label{
    width: 120px;
}
.layui-form-item .layui-textarea{
    width: 190px;
}
#phone-one-div {display: none}
.required{background:#F6CECE !important}
.unrequired{background:#eee}
#page-2 , #page-3 , #page-4{display:none}
td{font-family: "Microsoft YaHei"!important;color:#000 !important}
.layui-rate{padding:0}
.layui-table td{padding:4px 10px}
</style>
</head>
  
<body>
<div class="x-body">

    <form class="layui-form" style="float:left;margin-right:20px;">
    <input type="hidden" id="operator_id" name="operator_id" value="{$key}">
    <input type="hidden" id="check_id" name="check_id" value="{$info.id}">
    
    <table class="layui-table" style="width:845px">
        <tr>
            <td colspan="24" align="center" style="font-weight:bold;font-size:17px"><b>企业新员工价值观初步测评</b></td>
        </tr>
        <tr>
            <td width=""><b>一、判断题：70题，每题1分，共70分。</b></td>
        </tr>
        <tr>
            <td width="">1. 我加入公司是来实现自己的梦想的，只要对自己有利，有时候是可以损害公司利益的，公司好不好和我没关系。这样的想法是否正确？</td>
        </tr>
        <tr>
            <td width="">
                <input type="radio" name="answer[0]" value="对" title="对"><br>
                <input type="radio" name="answer[0]" value="错" title="错"> 
            </td>
        </tr>
        
    </table>
    
    
    </form>

</div>
<script>
layui.use(['form','layer','laydate','rate'], function(){
    $ = layui.jquery;
    var form = layui.form
    ,layer = layui.layer
    ,laydate = layui.laydate
    ,rate = layui.rate;
    
    {foreach name="pageListN" item="v"}
        {foreach name="score_1" id="s" key="kk"}
        rate.render({
            elem: '#score_{$s}_{$key}'
            ,choose: function(value){
                $('#score_{$s}_{$key}_input').val(value)
            }
            ,half: true
            ,value: 0
            ,text: true
            ,setText: function(value){
                this.span.text(value+'分');
                update_score({$key});
            }
        })
        {/foreach}
        {foreach name="score_2" id="s" key="kk"}
        rate.render({
            elem: '#score_{$s}_{$key}'
            ,choose: function(value){
              if(value > 0) 
                $('#score_{$s}_{$key}_input').val(value*2)
            }
            ,half: true
            ,value: 0
            ,text: true
            ,setText: function(value){
                this.span.text(value*2+'分');
                update_score({$key});
            }
        })
        {/foreach}
        {foreach name="score_3" id="s" key="kk"}
        rate.render({
            elem: '#score_{$s}_{$key}'
            ,choose: function(value){
                $('#score_{$s}_{$key}_input').val(value*3)
            }
            ,half: true
            ,value: 0
            ,text: true
            ,setText: function(value){
                this.span.text(value*3+'分');
                update_score({$key});
            }
        })
        {/foreach}
    {/foreach}
    
    function update_score(id)
    {
        var total = 0;
        for(i=1;i<12;i++){
            v = $('#score_'+i+'_'+id+'_input').val()-1+1;
            total += v;
        }
        $('#score_total_'+id).val(total);
    }
    
    form.on('submit(save)', function(data){
        layer.confirm('是否确认要提交考核表？', {
            btn: ['确定','取消']
        }, function(){
            $.ajax({
                type:'POST',
                dataType:'json',
                data:data.field,
                success:function(obj){
                    layer.alert(obj.msg, {icon: obj.icon},function(){
                        // var index = parent.layer.getFrameIndex(window.name);
                        // parent.layer.close(index);
                        // x_admin_father_reload();
                        window.location.reload();
                    });    
                }
            });
        }, function(){
            
        });
        

        return false;
    });
});
</script>
</body>

</html>
            
            
            